Skip to content

Harden the agentic pilot pipeline before the next paid run - #65

Merged
aktasbatuhan merged 2 commits into
mainfrom
harden-agentic-pipeline
Sep 17, 2026
Merged

aktasbatuhan merged 2 commits into
mainfrom
harden-agentic-pipeline

Conversation

@aktasbatuhan

Copy link
Copy Markdown
Owner

The repaired flex-pilot implementation existed only in the working tree, so a fresh clone had none of it. This lands it, and closes three ways the pipeline could spend money and still hand back a result nobody can trust.

What was broken

Failures kept no evidence. An episode recorded error_type and nothing else: no message, no traceback, no failing path. The 2026-09-16 run died after 635s of paid inference as a bare FileNotFoundError and cannot be diagnosed now, because none of that was written down. _persist_failure now keeps the message and traceback beside the outcome, whether or not the worker log survives.

Tau's checkpoint path was assumed, not checked. run_domain rebuilds save_to as DATA_DIR / "simulations" / f"{save_to}.json", so a relative stem is silently relocated under tau's package data and the episode cannot find its own grade. An absolute stem survives that join only because pathlib drops the base when the joined part is absolute. That contract is now verified before the episode starts, so a path mistake costs milliseconds instead of a full paid episode. The lookup also no longer goes through with_suffix, which truncates any stem containing a dot.

Truncated output was scored as a wrong answer. The gateway clamps the harness's requested max_tokens down to the spec ceiling and recorded neither the clamp nor finish_reason, so a reply cut off at the ceiling and a model that genuinely answered badly produced identical evidence. Calls now carry requested_output_tokens, max_output_tokens, output_cap_applied, finish_reason and output_truncated.

For review

budget-curve-v1.json still sets max_output_tokens to 4096, which clamps the retail agent's 8192 request. Raising it changes how many calls fit inside each agent allowance, so it is a design decision rather than something to change quietly. It is at least visible in the call log now.

The tier-echo gate is unchanged and still blocks the pilot. Doubleword chat completions does not echo service_tier, confirmed on DeepSeek-V4.1-Flash on 2026-09-17 across four calls on both tiers, so agentic_run stops at qualification as designed.

Verification

Offline suite: 626 passed, 3 skipped. New tests cover the output clamp and truncation flags, the absolute-stem contract, rejection of a relative stem, and stems containing a dot.

No paid run is launched by this change.

aktasbatuhan and others added 2 commits September 17, 2026 15:50
The repaired flex-pilot implementation existed only in the working tree, so a
fresh clone had none of it. This lands it, and closes three ways the pipeline
could spend money and still hand back a result nobody can trust.

Failures kept no evidence. An episode recorded `error_type` and nothing else:
no message, no traceback, no failing path. The 2026-09-16 run died after 635s
of paid inference as a bare `FileNotFoundError` and cannot be diagnosed now,
because none of that was written down. `_persist_failure` now keeps the message
and traceback beside the outcome, whether or not the worker log survives.

Tau's checkpoint path was assumed, not checked. `run_domain` rebuilds save_to as
`DATA_DIR / "simulations" / f"{save_to}.json"`, so a relative stem is silently
relocated under tau's package data and the episode cannot find its own grade.
An absolute stem survives only because pathlib drops the base when the joined
part is absolute. That contract is now verified before the episode starts, so a
path mistake costs milliseconds instead of a full paid episode, and the lookup
no longer goes through `with_suffix`, which truncates any stem with a dot.

Truncated output was scored as a wrong answer. The gateway clamps the harness's
requested max_tokens down to the spec ceiling and recorded neither the clamp nor
`finish_reason`, so a reply cut off at the ceiling and a model that genuinely
answered badly produced identical evidence. Calls now carry
`requested_output_tokens`, `max_output_tokens`, `output_cap_applied`,
`finish_reason` and `output_truncated`.

The budget-curve-v1 spec still sets `max_output_tokens` to 4096, which clamps
the retail agent's 8192 request. That is a design decision for review, not a
silent default; it is now at least visible in the call log.

Offline suite: 626 passed, 3 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`max_output_tokens` was 4096 while the retail harness asks for 8192, so the
gateway silently halved every reply. A truncated reply grades the same as a
wrong one, which meant the cap was buying a measurement error, not a saving.
It is now 8192, so the control no longer binds, with a test to keep it that way.

Output is reserved in full before each call under the fixed policy, so the
reservation per call doubles: $0.00246 to $0.00492 standard, $0.00197 to
$0.00393 flex. Against the $0.01 allowance the output side alone now reserves
49% standard and 39% flex before any input, and input reserves at the 1h
cache-write multiplier of 2.0. The $0.01 cell can afford very few calls. That
cell measures this harness's reservation policy at that allowance, not the
model's ability, and its budget stops must be reported rather than folded into
a success rate.

Offline suite: 627 passed, 3 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aktasbatuhan
aktasbatuhan merged commit 8e86ddf into main Sep 17, 2026
@aktasbatuhan
aktasbatuhan deleted the harden-agentic-pipeline branch September 17, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant